

#ifndef xm_log_hpp
#define xm_log_hpp

#include <log4cplus/loggingmacros.h>
#include <log4cplus/logger.h>
#include <log4cplus/fileappender.h>
#include <log4cplus/consoleappender.h>
#include <log4cplus/layout.h>
#include <log4cplus/configurator.h>
#include <log4cplus/clogger.h>

extern "C"{
    void xm_log_init(const char * config_file);
}


//#define dbgv(...) LOG4CPLUS_TRACE_FMT(log4cplus::Logger::getRoot(), __VA_ARGS__)
//#define dbgi(...) LOG4CPLUS_INFO_FMT(log4cplus::Logger::getRoot(), __VA_ARGS__)
//#define dbgw(...) LOG4CPLUS_WARN_FMT(log4cplus::Logger::getRoot(), __VA_ARGS__)
//#define dbge(...) LOG4CPLUS_ERROR_FMT(log4cplus::Logger::getRoot(), __VA_ARGS__)


#define dbgd(...) log4cplus_logger_log(NULL, L4CP_DEBUG_LOG_LEVEL, __VA_ARGS__)
#define dbgv(...) log4cplus_logger_log(NULL, L4CP_TRACE_LOG_LEVEL, __VA_ARGS__)
#define dbgi(...) log4cplus_logger_log(NULL, L4CP_INFO_LOG_LEVEL, __VA_ARGS__)
#define dbgw(...) log4cplus_logger_log(NULL, L4CP_WARN_LOG_LEVEL, __VA_ARGS__)
#define dbge(...) log4cplus_logger_log(NULL, L4CP_ERROR_LOG_LEVEL, __VA_ARGS__)

#define gdbgi(FMT, ARGS...) dbgi("|global| " FMT, ##ARGS )
#define gdbge(FMT, ARGS...) dbge("|golbal| " FMT, ##ARGS )

#endif /* xm_log_hpp */
